#!/bin/sh

BIT_CONFIG_DIR="$HOME/.BitCreekConfig"
SSL_KEYSTORE="$BIT_CONFIG_DIR/server.keystore"
SSL_KEYSTORE_PASSWORD="123456"

mkdir -p $BIT_CONFIG_DIR
if [ ! -f $SSL_KEYSTORE ]
then
	echo "Certificate not present."
	echo "Creating..."
	keytool -genkey -keystore $SSL_KEYSTORE -keyalg RSA -storepass $SSL_KEYSTORE_PASSWORD
fi

#if ! nc -z 127.0.0.1 1099
#then
#	echo "Runninging rmiregistry..."
#	rmiregistry &
#	sleep 3
#fi

ant -DBIT_SETTINGS_DIR=$BIT_CONFIG_DIR -DSSL_KEYSTORE_PASSWORD=$SSL_KEYSTORE_PASSWORD Tracker

